package com.lxy.cloud.order.feign;

import com.lxy.cloud.order.feign.model.User;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * feign的失败回滚函数类
 *
 * @author chengxi
 * @date 2018/12/4 23:00
 */
@Component
public class OrderFeignClientFallback implements IOrderService {

    /**
     * 在配置文件中开启feign的熔断机制，然后继承feign的访问服务类的接口实现其方法作为访问服务类方法失败的回滚方法，当然也需要在feign接口中定义
     *
     * @return
     */
    @Override
    @RequestMapping("/hello")
    public String hello() {
        return "order server was down";
    }

    @Override
    public String get(User user) {
        return null;
    }
}